Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

447
Visualizações
Having "You do not have permission to call ScriptApp.newTrigger" Error in Google Forms Script Editor"

I have a Google form (From_1) that creates a Google doc and another form (Form_2). Form_2 is created from a template that contains its own Apps Script. When creating Form_2, I want to also create an onSubmit() trigger for that form. However, I get an error that states:

Exception: You do not have permission to call ScriptApp.newTrigger. Required permissions: https://www.googleapis.com/auth/script.scriptapp

My appscript.json looks like:

{
  "oauthScopes": [
      "https://www.googleapis.com/auth/script.scriptapp"
  ],
  "timeZone": "America/New_York",
  "dependencies": {
  },
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8"
}

Here is the code I'm using to create Form_2 and my attempt to create the onSubmit() trigger. How can I create a form with an onSubmit() trigger?

// Create job offer form
var templateOfferForm = DriveApp.getFileById('my_form_id_number');
  
//create a copy of the template, we don't wanna mess up the template doc
var offerForm = templateOfferForm.makeCopy();
  
//open the new template form for editing
var openForm = FormApp.openById(offerForm.getId());
  
// Setting title name
openForm.setTitle(items[1].getResponse());

// Setting name in form
offerForm.setName('Job offer form: ' + items[1].getResponse());

// Setting the trigger for the new form
ScriptApp.newTrigger('onFormSubmit')
.forForm(FormApp.getActiveForm().getId())
.onFormSubmit()
.onOpen()
.create();
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda